﻿@model PagedList.IPagedList<blogDemo.Models.artic>
@using PagedList
@using PagedList.Mvc

<section id="blog-page">
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                @using (Html.BeginForm("Search", "artic", FormMethod.Get, new { id = "search-form", role = "search" }))
                {
                    <input type="text" class="form-control" placeholder="Search..." autocomplete="on" name="keyword">
                    <button type="submit" title="Search" id="search-submit">
                        <i class="fa fa-search"></i>
                    </button>
                }
            </div>
        </div>
        <hr />
        <div class="row">

            <div id="blog-posts" class="col-md-10 col-md-offset-1 text-center">
                <div class="post-item">
                    @foreach (var item in Model)
                    { <!-- Single Post -->
                        <article class="entry wow fadeInDown" data-wow-duration="1000ms" data-wow-delay="300ms">

                            <div class="post-excerpt">
                                <h3> @Html.ActionLink(item.title, "Detail", new { id = item.ID }) </h3>
                                @(new MvcHtmlString(item.content))
                                <p><a class="btn btn-transparent" href="/artic/Detail/@item.ID">阅读全文 &raquo;</a></p>
                            </div>
                            <div class="post-meta">
                                <span class="post-date">
                                    <i class="fa fa-calendar"></i>@Html.DisplayFor(modelItem => item.date)
                                </span>
                                <span class="post-view">
                                    <i class="fa fa-eye"></i>@Html.DisplayFor(modelItem => item.views)
                                </span>
                                <span class="author">
                                    <i class="fa fa-user"></i><a href="#">@Html.DisplayFor(modelItem => item.author)</a>
                                </span>
                                <span class="post-tags">
                                    <i class="fa fa-tags"></i><a href="#">@Html.DisplayFor(modelItem => item.label)</a>
                                </span>
                            </div>
                        </article>
                        <!-- End Single Post --> 
                    }
                    <nav class="post-pagination wow fadeInDown" data-wow-duration="1000ms" data-wow-delay="300ms">
                        @Html.PagedListPager(Model, page => Url.Action("blog", new { page }))
                    </nav>
                </div>
            </div>  <!-- blog-posts -->

        </div>	    <!-- End row -->
    </div>       <!-- End container -->
</section>    <!-- End Section -->